package com.title1;

import java.io.*;
import java.net.Socket;

/**
 * @Author milian
 * @Date 2021/8/10 0010 19:36
 */
public class client {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1",10000);
        BufferedOutputStream bos = new BufferedOutputStream(socket.getOutputStream());
        BufferedReader br = new BufferedReader(new FileReader("H:\\homework\\day16\\src\\com\\title1\\illust_13232953_20171118_223108.jpg"));
        int len;
        while ((len=br.read())!=-1){
            bos.write(len);
        }
        socket.shutdownOutput();
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        String line;
        while ((line=bufferedReader.readLine())!=null){
            System.out.println(line);
        }
        bufferedReader.close();
        socket.close();
    }
}
